package com.dreamthen.service.impl;

import com.dreamthen.service.IGamePlayer;

/***
 * @Author zengms
 * @Date 2023-10-16 21:35:31
 *
 * 代练
 */
public class GameProxyPlayer implements IGamePlayer {

    private String name;
    private GamePlayer gamePlayer; //目标对象

    //需要跟代练建立关系，否则不知道具体给谁代理
    public GameProxyPlayer(String name) {
        this.name=name;
        this.gamePlayer=new GamePlayer(name);
    }

    //代练 获取代理对象拿到对于的账号并登录
    public void start() {
        System.out.println("拿到"+name+"用户名，密码");
        gamePlayer.start();
    }

    public void play() {
        System.out.println("代理击杀了玩家，赢得了游戏");
    }
}
